<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
 * App\Models\GoldSeed
 *
 * @property int $id
 * @property string|null $title
 * @property int $product_id
 * @property int $all_rounds
 * @property string $init_price
 * @property int $split_gold_round_id
 * @property int $split_amount
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\GoldProduct[] $goldProducts
 * @property-read int|null $gold_products_count
 * @property-read \App\Models\Product|null $product
 * @property-read \App\Models\GoldRound|null $splitGoldRound
 * @method static \Database\Factories\GoldSeedFactory factory(...$parameters)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed query()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereAllRounds($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereInitPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereProductId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereSplitAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereSplitGoldRoundId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSeed whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class GoldSeed extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

	public function goldProducts()
	{
		return $this->hasMany(GoldProduct::class, 'gold_seed_id', 'id');
	}

	public function product()
	{
		return $this->belongsTo(Product::class);
	}

    public function splitGoldRound()
    {
        return $this->belongsTo(GoldRound::class, 'split_gold_round_id', 'id');
    }
}
